(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/storehouse/outScanningCode"], {
        "02c0": function (t, e, n) {
            "use strict";
            n.d(e, "b", (function () {
                return i
            })), n.d(e, "c", (function () {
                return s
            })), n.d(e, "a", (function () {
                return o
            }));
            var o = {
                    uniForms: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-forms/uni-forms")]).then(n.bind(null, "0933"))
                    },
                    uniSwipeAction: function () {
                        return n.e("components/uni-swipe-action/uni-swipe-action").then(n.bind(null, "e7b4"))
                    },
                    uniSwipeActionItem: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-swipe-action-item/uni-swipe-action-item")]).then(n.bind(null, "c498"))
                    }
                },
                i = function () {
                    var t = this.$createElement;
                    this._self._c
                },
                s = []
        },
        "0ea3": function (t, e, n) {
            "use strict";
            n.r(e);
            var o = n("02c0"),
                i = n("dd8f");
            for (var s in i)["default"].indexOf(s) < 0 && function (t) {
                n.d(e, t, (function () {
                    return i[t]
                }))
            }(s);
            n("8cfb");
            var r = n("f0c5"),
                a = Object(r["a"])(i["default"], o["b"], o["c"], !1, null, "4a24e394", null, !1, o["a"], void 0);
            e["default"] = a.exports
        },
        "235d": function (t, e, n) {},
        "31ea": function (t, e, n) {
            "use strict";
            (function (t) {
                var o = n("4ea4");
                Object.defineProperty(e, "__esModule", {
                    value: !0
                }), e.default = void 0;
                var i = o(n("2eee")),
                    s = o(n("c973")),
                    // r = t.requireNativePlugin("wyQrCodeModule"),
                    a = {
                        data: function () {
                            return {
                                url: getApp().globalData.apiurl,
                                model: "暂无传参",
                                coutWeight: void 0,
                                outList: [],
                                qrList: [],
                                dataList: [],
                                isAutoScan: !1,
                                scanInState: !1,
                                receiptdocNoList: [],
                                endVerList: []
                            }
                        },
                        onLoad: function (t) {
                            this.model = t.outId, this.initData(t.outId), this.init(), this.startScan()
                        },
                        methods: {
                            init: function () {
                                var t = this;
                                r.initQrcode((function (e) {
                                    if (!e) return t.getToast("请重新登录系统！", !1)
                                }))
                            },
                            startScan: function () {
                                var t = this;
                                r.startScan(this.isAutoScan, (function (e) {
                                    if (console.log("当前二维码状态：" + !t.scanInState), t.scanInState) {
                                        if (!e) return t.getToast("失败！请联系管理员");
                                        t.getGoodsInfo(e)
                                    } else t.scanInState = !0
                                }))
                            },
                            getGoodsInfo: function (e) {
                                var n = this;
                                return console.log("二维码中信息：" + e), 3 != e.split("no=").length ? this.getToast("二维码无效！", !1) : this.receiptdocNoList.find((function (t) {
                                    return t === e.split("no=")[2]
                                })) ? this.getToast("重复扫描！", !1) : void t.request({
                                    url: this.url + "receiptdoc/receiptdoc/queryGoodListByNo",
                                    method: "GET",
                                    data: {
                                        receiptdocno: e.split("no=")[2]
                                    },
                                    success: function (t) {
                                        return 0 == t.data.length ? n.getToast("该货品已出库！", !1) : 500 == t.data.code ? n.getToast("二维码无效！", !1) : (n.checkOutInfo(e) && n.qrList.push(t.data), void n.handleList())
                                    }
                                })
                            },
                            checkOutInfo: function (t) {
                                var e = this;
                                this.outList.find((function (e) {
                                    return e.goodsno === t.split("no=")[1]
                                })) || this.getToast("禁止出库！", !1);
                                var n = !1;
                                return this.outList.forEach((function (o) {
                                    t.split("no=")[1] == o.goodsno && (o.spare < o.weight || void 0 == o.spare ? (e.receiptdocNoList.push(t.split("no=")[2]), n = !0) : (e.getToast("重量已达标！", !1), n = !1))
                                })), n
                            },
                            handleList: function () {
                                var t = this;
                                console.log("当前已扫描货品：" + this.qrList), this.outList.forEach((function (e) {
                                    e.spare = 0, t.qrList.forEach((function (t) {
                                        e.goodsno == t.goodsno && (e.spare += t.weight)
                                    })), e.spare = parseFloat(e.spare).toFixed(2)
                                }))
                            },
                            initData: function (e) {
                                var n = this;
                                return (0, s.default)(i.default.mark((function o() {
                                    return i.default.wrap((function (o) {
                                        while (1) switch (o.prev = o.next) {
                                            case 0:
                                                console.log(e), t.request({
                                                    url: n.url + "outboundorder/outboundorder/queryGoodListById",
                                                    method: "GET",
                                                    data: {
                                                        outId: e
                                                    },
                                                    success: function (t) {
                                                        n.outList = t.data
                                                    }
                                                });
                                            case 2:
                                            case "end":
                                                return o.stop()
                                        }
                                    }), o)
                                })))()
                            },
                            endSubmitVerification: function () {
                                var t = this;
                                if (0 == this.qrList.length || this.qrList == []) return this.getToast("请扫码出库！", !1);
                                this.endVerList = [], this.outList.forEach((function (e) {
                                    var n = 0;
                                    t.qrList.forEach((function (t) {
                                        e.goodsno == t.goodsno && (n += t.weight)
                                    })), e.spare <= parseFloat(n).toFixed(2) ? t.endVerList.push("true") : t.endVerList.push("false")
                                }))
                            },
                            submitForm: function () {
                                var e = this;
                                if (0 == this.qrList.length || this.qrList == []) return this.getToast("请扫码出库！", !1);
                                if (this.endVerList = [], this.outList.forEach((function (t) {
                                        var n = 0;
                                        e.qrList.forEach((function (e) {
                                            t.goodsno == e.goodsno && (n += e.weight)
                                        })), t.spare <= parseFloat(n).toFixed(2) && 0 != t.spare ? e.endVerList.push("true") : e.endVerList.push("false")
                                    })), this.endVerList.find((function (t) {
                                        return "false" === t
                                    }))) return this.getToast("有未扫码货品", !1);
                                var n = getApp().globalData.userinfo.nickName,
                                    o = "";
                                this.receiptdocNoList.forEach((function (t) {
                                    o += t.trim() + ","
                                })), t.request({
                                    url: this.url + "receiptdoc/receiptdoc/updataRecState",
                                    method: "PUT",
                                    data: {
                                        receiptdocNo: o,
                                        outIssueid: this.model
                                    }
                                }), t.request({
                                    url: this.url + "outboundorder/outboundorder/confirm",
                                    method: "GET",
                                    data: {
                                        id: this.model,
                                        maintainpeople: n
                                    },
                                    success: function (n) {
                                        e.getToast("发料成功！", !0), setTimeout((function () {
                                            t.redirectTo({
                                                url: "/pages/main/storehouse/out"
                                            })
                                        }), 300)
                                    },
                                    complete: function () {
                                        e.outList.forEach((function (n) {
                                            t.request({
                                                url: e.url + "sale/product",
                                                method: "PUT",
                                                data: {
                                                    id: n.id,
                                                    spare: n.spare
                                                }
                                            })
                                        }))
                                    }
                                })
                            },
                            getToast: function (t, e) {
                                plus.nativeUI.toast('<font style="font-size:32px">' + t + "</font>", {
                                    verticalAlign: "center",
                                    type: "richtext",
                                    icon: e ? "/static/icon/success.png" : "/static/icon/error.png",
                                    duration: "short",
                                    richTextStyle: {
                                        align: "center",
                                        fontSrc: "static/font/...otf"
                                    }
                                })
                            },
                            stopScan: function () {
                                r.stopScan()
                            },
                            release: function () {
                                r.releaseQrcode()
                            }
                        },
                        onUnload: function () {
                            this.stopScan(), this.release()
                        }
                    };
                e.default = a
            }).call(this, n("543d")["default"])
        },
        "8cfb": function (t, e, n) {
            "use strict";
            var o = n("235d"),
                i = n.n(o);
            i.a
        },
        d343: function (t, e, n) {
            "use strict";
            (function (t, e) {
                var o = n("4ea4");
                n("c150"), n("5c17"), n("a9ff");
                o(n("66fd"));
                var i = o(n("0ea3"));
                t.__webpack_require_UNI_MP_PLUGIN__ = n, e(i.default)
            }).call(this, n("bc2e")["default"], n("543d")["createPage"])
        },
        dd8f: function (t, e, n) {
            "use strict";
            n.r(e);
            var o = n("31ea"),
                i = n.n(o);
            for (var s in o)["default"].indexOf(s) < 0 && function (t) {
                n.d(e, t, (function () {
                    return o[t]
                }))
            }(s);
            e["default"] = i.a
        }
    },
    [
        ["d343", "common/runtime", "common/vendor"]
    ]
]);